/*
 * @Description:
 * @Author: Rfan
 * @Date: 2022-05-12 09:27:20
 * @LastEditTime: 2022-12-30 15:08:18
 */

import classNames from 'classnames/bind';
import { DescDesignRouterTypeContext } from '@/view/system/DescDesign/contexts/DescDesignRouterTypeContext';
import { DescDesignContextProvider } from './contexts/DescDesignContext';
import NavSidebar from './components/NavSidebar';
import PageContent from './components/PageContent';
import PageLayout from '@/layout/PageLayout';
import { EnumDescDesignRouteTypes } from '@/view/system/DescDesign/dictionaries';
import styles from './styles/descDesignMain.module.scss';

const cx = classNames.bind(styles);

interface ISystemDescDesignProps {
  routerType?: EnumDescDesignRouteTypes;
}

export const SettingDescDesignPage = (props: ISystemDescDesignProps) => {
  const { routerType = EnumDescDesignRouteTypes.Normal } = props;

  return (
    <DescDesignRouterTypeContext.Provider value={{ routerType }}>
      <DescDesignContextProvider>
        <PageLayout className={cx('page-wrap')} sidebar={<NavSidebar />}>
          <PageContent />
        </PageLayout>
      </DescDesignContextProvider>
    </DescDesignRouterTypeContext.Provider>
  );
};

const SettingDescDesignMain = () => {
  return <SettingDescDesignPage />;
};

export default SettingDescDesignMain;
